// At this point, name is a UCS-16 encoded, zero terminated string.
// All our internals use UTF-8 encoding, so convert now.
int olen = strlen(name);
- track->rte_name = cet_str_uni_to_utf8((const short int*) name, olen);
+
+ QScopedPointer<char, QScopedPointerPodDeleter>rte_name (cet_str_uni_to_utf8((const short int*) name, olen));
+ track->rte_name = rte_name.take();
// skip two pair waypoint
gbfseek(fin, 8*4, SEEK_CUR);
if ((mps_ver == 4) || (mps_ver == 5)) {
gbfread(tbuf, 6, 1, mps_file); /* unknown */
QScopedPointer<char, QScopedPointerPodDeleter>wptnotes (gbfgetcstr(mps_file));
- thisWaypoint->notes = *wptnotes;
+ thisWaypoint->notes = wptnotes.take();
} else {
gbfread(tbuf, 2, 1, mps_file); /* unknown */
}
thisWaypoint->shortname = wptname;
- thisWaypoint->description = *wptdesc;
+ thisWaypoint->description = wptdesc.take();
thisWaypoint->latitude = GPS_Math_Semi_To_Deg(lat);
thisWaypoint->longitude = GPS_Math_Semi_To_Deg(lon);
thisWaypoint->altitude = mps_altitude;
#endif
rte_head = route_head_alloc();
- rte_head->rte_name = *rtename;
+ rte_head->rte_name = rtename.take();
route_add_head(rte_head);
*rte = rte_head;
#endif
track_head = route_head_alloc();
- track_head->rte_name = *trkname;
+ track_head->rte_name = trkname.take();
track_add_head(track_head);
*trk = track_head;